From bcad3bee3b7e31500dcfb8c49893b652c3d87bf5 Mon Sep 17 00:00:00 2001 From: Michal Bajer Date: Wed, 25 Oct 2023 07:24:09 +0000 Subject: [PATCH] build(deps): wip replace packages Signed-off-by: Michal Bajer --- extensions/cactus-plugin-object-store-ipfs/README.md | 2 +- packages/cactus-plugin-odap-hermes/package.json | 2 +- .../integration/backup-gateway-after-client-crash.test.ts | 5 +++-- .../integration/client-crash-after-delete-asset.test.ts | 5 +++-- .../integration/client-crash-after-lock-asset.test.ts | 5 +++-- .../client-crash-after-transfer-initiation.test.ts | 5 +++-- .../odap-api-call-with-ledger-connector.test.ts | 6 ++++-- .../src/test/typescript/integration/odap-api-call.test.ts | 7 +++++-- .../src/test/typescript/integration/odap-rollback.test.ts | 5 +++-- .../src/test/typescript/integration/odap.test.ts | 5 +++-- .../integration/server-crash-after-create-asset.test.ts | 5 +++-- .../server-crash-after-transfer-initiation.test.ts | 5 +++-- .../src/test/typescript/unit/client/commit-final.test.ts | 5 +++-- .../src/test/typescript/unit/recovery/logging.test.ts | 6 ++++-- .../test/typescript/unit/recovery/recover-success.test.ts | 5 +++-- .../typescript/unit/recovery/recover-update-ack.test.ts | 6 ++++-- .../test/typescript/unit/recovery/recover-update.test.ts | 5 +++-- .../src/test/typescript/unit/recovery/recover.test.ts | 5 +++-- .../src/test/typescript/unit/server/commit-final.test.ts | 5 +++-- .../src/test/typescript/unit/server/lock-evidence.test.ts | 6 ++++-- packages/cactus-plugin-odap-hermes/tsconfig.json | 3 +++ yarn.lock | 2 +- 22 files changed, 66 insertions(+), 39 deletions(-) diff --git a/extensions/cactus-plugin-object-store-ipfs/README.md b/extensions/cactus-plugin-object-store-ipfs/README.md index 0991fea56dc..7f5872bcc37 100644 --- a/extensions/cactus-plugin-object-store-ipfs/README.md +++ b/extensions/cactus-plugin-object-store-ipfs/README.md @@ -46,7 +46,7 @@ This plugin uses OpenAPI to generate the API paths. There are three endpoints de Firstly create an instance of the plugin. ```typescript -import { create } from "ipfs-http-client"; +import { create } from "kubo-rpc-client"; const logLevel: LogLevelDesc = "TRACE"; const ipfsClientOrOptions = create(); diff --git a/packages/cactus-plugin-odap-hermes/package.json b/packages/cactus-plugin-odap-hermes/package.json index 3bfbdd8d9d4..fe3ce203209 100644 --- a/packages/cactus-plugin-odap-hermes/package.json +++ b/packages/cactus-plugin-odap-hermes/package.json @@ -68,12 +68,12 @@ "web3-utils": "1.6.1" }, "devDependencies": { + "@hyperledger/cacti-esm-compat-hacks": "2.0.0-alpha.2", "@types/crypto-js": "4.0.1", "@types/express": "4.17.19", "@types/tape": "4.13.4", "crypto-js": "4.0.0", "fabric-network": "2.2.19", - "ipfs-http-client": "60.0.1", "typescript": "4.9.5" }, "engines": { diff --git a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/backup-gateway-after-client-crash.test.ts b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/backup-gateway-after-client-crash.test.ts index d38dc8708d3..aff97daa844 100644 --- a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/backup-gateway-after-client-crash.test.ts +++ b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/backup-gateway-after-client-crash.test.ts @@ -5,7 +5,6 @@ import { Server as SocketIoServer } from "socket.io"; import { AddressInfo } from "net"; import { v4 as uuidv4 } from "uuid"; import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs"; -import { create } from "ipfs-http-client"; import bodyParser from "body-parser"; import express from "express"; import { DefaultApi as ObjectStoreIpfsApi } from "@hyperledger/cactus-plugin-object-store-ipfs"; @@ -53,6 +52,7 @@ import { ReceiptType, Web3SigningCredential, } from "@hyperledger/cactus-plugin-ledger-connector-besu"; +import { dynamicImportKuboRpcClientESMWorkaround } from "@hyperledger/cacti-esm-compat-hacks"; import Web3 from "web3"; import { makeSessionDataChecks } from "../make-checks"; @@ -161,7 +161,8 @@ beforeAll(async () => { const ipfsApiUrl = await ipfsContainer.getApiUrl(); - const ipfsClientOrOptions = create({ + const kuboRpcModule = await dynamicImportKuboRpcClientESMWorkaround(); + const ipfsClientOrOptions = kuboRpcModule.create({ url: ipfsApiUrl, }); diff --git a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/client-crash-after-delete-asset.test.ts b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/client-crash-after-delete-asset.test.ts index 7e745b4928e..453256994f9 100644 --- a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/client-crash-after-delete-asset.test.ts +++ b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/client-crash-after-delete-asset.test.ts @@ -5,7 +5,6 @@ import { Server as SocketIoServer } from "socket.io"; import { AddressInfo } from "net"; import { v4 as uuidv4 } from "uuid"; import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs"; -import { create } from "ipfs-http-client"; import bodyParser from "body-parser"; import express from "express"; import { DefaultApi as ObjectStoreIpfsApi } from "@hyperledger/cactus-plugin-object-store-ipfs"; @@ -52,6 +51,7 @@ import { ReceiptType, Web3SigningCredential, } from "@hyperledger/cactus-plugin-ledger-connector-besu"; +import { dynamicImportKuboRpcClientESMWorkaround } from "@hyperledger/cacti-esm-compat-hacks"; import Web3 from "web3"; import { makeSessionDataChecks } from "../make-checks"; @@ -158,7 +158,8 @@ beforeAll(async () => { const ipfsApiUrl = await ipfsContainer.getApiUrl(); - const ipfsClientOrOptions = create({ + const kuboRpcModule = await dynamicImportKuboRpcClientESMWorkaround(); + const ipfsClientOrOptions = kuboRpcModule.create({ url: ipfsApiUrl, }); diff --git a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/client-crash-after-lock-asset.test.ts b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/client-crash-after-lock-asset.test.ts index 2ff164096c1..e1942658e57 100644 --- a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/client-crash-after-lock-asset.test.ts +++ b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/client-crash-after-lock-asset.test.ts @@ -5,7 +5,6 @@ import { Server as SocketIoServer } from "socket.io"; import { AddressInfo } from "net"; import { v4 as uuidv4 } from "uuid"; import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs"; -import { create } from "ipfs-http-client"; import bodyParser from "body-parser"; import express from "express"; import { DefaultApi as ObjectStoreIpfsApi } from "@hyperledger/cactus-plugin-object-store-ipfs"; @@ -52,6 +51,7 @@ import { ReceiptType, Web3SigningCredential, } from "@hyperledger/cactus-plugin-ledger-connector-besu"; +import { dynamicImportKuboRpcClientESMWorkaround } from "@hyperledger/cacti-esm-compat-hacks"; import Web3 from "web3"; import { makeSessionDataChecks } from "../make-checks"; @@ -158,7 +158,8 @@ beforeAll(async () => { const ipfsApiUrl = await ipfsContainer.getApiUrl(); - const ipfsClientOrOptions = create({ + const kuboRpcModule = await dynamicImportKuboRpcClientESMWorkaround(); + const ipfsClientOrOptions = kuboRpcModule.create({ url: ipfsApiUrl, }); diff --git a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/client-crash-after-transfer-initiation.test.ts b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/client-crash-after-transfer-initiation.test.ts index b8ec81571da..16116e5edde 100644 --- a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/client-crash-after-transfer-initiation.test.ts +++ b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/client-crash-after-transfer-initiation.test.ts @@ -3,7 +3,6 @@ import type { AddressInfo } from "net"; import { v4 as uuidv4 } from "uuid"; import "jest-extended"; import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs"; -import { create } from "ipfs-http-client"; import bodyParser from "body-parser"; import express, { Express } from "express"; import { DefaultApi as ObjectStoreIpfsApi } from "@hyperledger/cactus-plugin-object-store-ipfs"; @@ -19,6 +18,7 @@ import { PluginOdapGateway, } from "../../../main/typescript/gateway/plugin-odap-gateway"; import { GoIpfsTestContainer } from "@hyperledger/cactus-test-tooling"; +import { dynamicImportKuboRpcClientESMWorkaround } from "@hyperledger/cacti-esm-compat-hacks"; import { AssetProfile, ClientV1Request, @@ -93,7 +93,8 @@ beforeAll(async () => { const ipfsApiUrl = await ipfsContainer.getApiUrl(); - const ipfsClientOrOptions = create({ + const kuboRpcModule = await dynamicImportKuboRpcClientESMWorkaround(); + const ipfsClientOrOptions = kuboRpcModule.create({ url: ipfsApiUrl, }); diff --git a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap-api-call-with-ledger-connector.test.ts b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap-api-call-with-ledger-connector.test.ts index 30f4541858b..3c6e376a1a2 100644 --- a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap-api-call-with-ledger-connector.test.ts +++ b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap-api-call-with-ledger-connector.test.ts @@ -5,7 +5,6 @@ import { Server as SocketIoServer } from "socket.io"; import { AddressInfo } from "net"; import { v4 as uuidv4 } from "uuid"; import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs"; -import { create } from "ipfs-http-client"; import bodyParser from "body-parser"; import express from "express"; import { DefaultApi as ObjectStoreIpfsApi } from "@hyperledger/cactus-plugin-object-store-ipfs"; @@ -53,6 +52,7 @@ import { PluginFactoryLedgerConnector, Web3SigningCredential, } from "@hyperledger/cactus-plugin-ledger-connector-besu"; +import { dynamicImportKuboRpcClientESMWorkaround } from "@hyperledger/cacti-esm-compat-hacks"; import { makeSessionDataChecks } from "../make-checks"; import { @@ -65,6 +65,7 @@ import { } from "../../../main/typescript/gateway/besu-odap-gateway"; import { ClientGatewayHelper } from "../../../main/typescript/gateway/client/client-helper"; import { ServerGatewayHelper } from "../../../main/typescript/gateway/server/server-helper"; + /** * Use this to debug issues with the fabric node SDK * ```sh @@ -152,7 +153,8 @@ beforeAll(async () => { const ipfsApiUrl = await ipfsContainer.getApiUrl(); - const ipfsClientOrOptions = create({ + const kuboRpcModule = await dynamicImportKuboRpcClientESMWorkaround(); + const ipfsClientOrOptions = kuboRpcModule.create({ url: ipfsApiUrl, }); diff --git a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap-api-call.test.ts b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap-api-call.test.ts index db02da69e67..1213de425cd 100644 --- a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap-api-call.test.ts +++ b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap-api-call.test.ts @@ -3,7 +3,6 @@ import type { AddressInfo } from "net"; import { v4 as uuidv4 } from "uuid"; import "jest-extended"; import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs"; -import { create } from "ipfs-http-client"; import bodyParser from "body-parser"; import express from "express"; import { DefaultApi as ObjectStoreIpfsApi } from "@hyperledger/cactus-plugin-object-store-ipfs"; @@ -18,6 +17,8 @@ import { import { Configuration } from "@hyperledger/cactus-core-api"; import { GoIpfsTestContainer } from "@hyperledger/cactus-test-tooling"; +import { dynamicImportKuboRpcClientESMWorkaround } from "@hyperledger/cacti-esm-compat-hacks"; + import { PluginOdapGateway, IPluginOdapGatewayConstructorOptions, @@ -33,6 +34,7 @@ import { FabricOdapGateway } from "../../../main/typescript/gateway/fabric-odap- import { ClientGatewayHelper } from "../../../main/typescript/gateway/client/client-helper"; import { ServerGatewayHelper } from "../../../main/typescript/gateway/server/server-helper"; + const MAX_RETRIES = 5; const MAX_TIMEOUT = 5000; @@ -78,7 +80,8 @@ beforeAll(async () => { const ipfsApiUrl = await ipfsContainer.getApiUrl(); - const ipfsClientOrOptions = create({ + const kuboRpcModule = await dynamicImportKuboRpcClientESMWorkaround(); + const ipfsClientOrOptions = kuboRpcModule.create({ url: ipfsApiUrl, }); diff --git a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap-rollback.test.ts b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap-rollback.test.ts index 97e7a1437bd..9610127c826 100644 --- a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap-rollback.test.ts +++ b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap-rollback.test.ts @@ -5,7 +5,6 @@ import { Server as SocketIoServer } from "socket.io"; import { AddressInfo } from "net"; import { v4 as uuidv4 } from "uuid"; import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs"; -import { create } from "ipfs-http-client"; import bodyParser from "body-parser"; import express from "express"; import { DefaultApi as ObjectStoreIpfsApi } from "@hyperledger/cactus-plugin-object-store-ipfs"; @@ -52,6 +51,7 @@ import { ReceiptType, Web3SigningCredential, } from "@hyperledger/cactus-plugin-ledger-connector-besu"; +import { dynamicImportKuboRpcClientESMWorkaround } from "@hyperledger/cacti-esm-compat-hacks"; import Web3 from "web3"; import { @@ -155,7 +155,8 @@ beforeAll(async () => { const ipfsApiUrl = await ipfsContainer.getApiUrl(); - const ipfsClientOrOptions = create({ + const kuboRpcModule = await dynamicImportKuboRpcClientESMWorkaround(); + const ipfsClientOrOptions = kuboRpcModule.create({ url: ipfsApiUrl, }); diff --git a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap.test.ts b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap.test.ts index 6c1977936eb..1582d511b25 100644 --- a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap.test.ts +++ b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/odap.test.ts @@ -3,7 +3,6 @@ import type { AddressInfo } from "net"; import { v4 as uuidv4 } from "uuid"; import "jest-extended"; import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs"; -import { create } from "ipfs-http-client"; import bodyParser from "body-parser"; import express from "express"; import { DefaultApi as ObjectStoreIpfsApi } from "@hyperledger/cactus-plugin-object-store-ipfs"; @@ -16,6 +15,7 @@ import { v4 as uuidV4 } from "uuid"; import { Configuration } from "@hyperledger/cactus-core-api"; import { PluginOdapGateway } from "../../../main/typescript/gateway/plugin-odap-gateway"; import { GoIpfsTestContainer } from "@hyperledger/cactus-test-tooling"; +import { dynamicImportKuboRpcClientESMWorkaround } from "@hyperledger/cacti-esm-compat-hacks"; import { AssetProfile, ClientV1Request, @@ -66,7 +66,8 @@ beforeAll(async () => { const ipfsApiUrl = await ipfsContainer.getApiUrl(); - const ipfsClientOrOptions = create({ + const kuboRpcModule = await dynamicImportKuboRpcClientESMWorkaround(); + const ipfsClientOrOptions = kuboRpcModule.create({ url: ipfsApiUrl, }); diff --git a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/server-crash-after-create-asset.test.ts b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/server-crash-after-create-asset.test.ts index c0b820f1c97..a2ce8675269 100644 --- a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/server-crash-after-create-asset.test.ts +++ b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/server-crash-after-create-asset.test.ts @@ -5,7 +5,6 @@ import { Server as SocketIoServer } from "socket.io"; import { AddressInfo } from "net"; import { v4 as uuidv4 } from "uuid"; import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs"; -import { create } from "ipfs-http-client"; import bodyParser from "body-parser"; import express from "express"; import { DefaultApi as ObjectStoreIpfsApi } from "@hyperledger/cactus-plugin-object-store-ipfs"; @@ -52,6 +51,7 @@ import { ReceiptType, Web3SigningCredential, } from "@hyperledger/cactus-plugin-ledger-connector-besu"; +import { dynamicImportKuboRpcClientESMWorkaround } from "@hyperledger/cacti-esm-compat-hacks"; import Web3 from "web3"; import { makeSessionDataChecks } from "../make-checks"; @@ -157,7 +157,8 @@ beforeAll(async () => { const ipfsApiUrl = await ipfsContainer.getApiUrl(); - const ipfsClientOrOptions = create({ + const kuboRpcModule = await dynamicImportKuboRpcClientESMWorkaround(); + const ipfsClientOrOptions = kuboRpcModule.create({ url: ipfsApiUrl, }); diff --git a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/server-crash-after-transfer-initiation.test.ts b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/server-crash-after-transfer-initiation.test.ts index 5846727784b..998d847debb 100644 --- a/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/server-crash-after-transfer-initiation.test.ts +++ b/packages/cactus-plugin-odap-hermes/src/test/typescript/integration/server-crash-after-transfer-initiation.test.ts @@ -3,7 +3,6 @@ import type { AddressInfo } from "net"; import { v4 as uuidv4 } from "uuid"; import "jest-extended"; import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs"; -import { create } from "ipfs-http-client"; import bodyParser from "body-parser"; import express, { Express } from "express"; import { DefaultApi as ObjectStoreIpfsApi } from "@hyperledger/cactus-plugin-object-store-ipfs"; @@ -15,6 +14,7 @@ import { } from "@hyperledger/cactus-common"; import { Configuration } from "@hyperledger/cactus-core-api"; import { GoIpfsTestContainer } from "@hyperledger/cactus-test-tooling"; +import { dynamicImportKuboRpcClientESMWorkaround } from "@hyperledger/cacti-esm-compat-hacks"; import { AssetProfile, ClientV1Request, @@ -93,7 +93,8 @@ beforeAll(async () => { const ipfsApiUrl = await ipfsContainer.getApiUrl(); - const ipfsClientOrOptions = create({ + const kuboRpcModule = await dynamicImportKuboRpcClientESMWorkaround(); + const ipfsClientOrOptions = kuboRpcModule.create({ url: ipfsApiUrl, }); diff --git a/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/client/commit-final.test.ts b/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/client/commit-final.test.ts index 35cd56000a8..af5bf436d95 100644 --- a/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/client/commit-final.test.ts +++ b/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/client/commit-final.test.ts @@ -3,7 +3,6 @@ import { SHA256 } from "crypto-js"; import bodyParser from "body-parser"; import { v4 as uuidv4 } from "uuid"; import http, { Server } from "http"; -import { create } from "ipfs-http-client"; import { OdapMessageType, PluginOdapGateway, @@ -21,6 +20,7 @@ import { import { Configuration } from "@hyperledger/cactus-core-api"; import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs"; import { GoIpfsTestContainer } from "@hyperledger/cactus-test-tooling"; +import { dynamicImportKuboRpcClientESMWorkaround } from "@hyperledger/cacti-esm-compat-hacks"; import express from "express"; import { AddressInfo } from "net"; @@ -76,7 +76,8 @@ beforeAll(async () => { const ipfsApiUrl = await ipfsContainer.getApiUrl(); - const ipfsClientOrOptions = create({ + const kuboRpcModule = await dynamicImportKuboRpcClientESMWorkaround(); + const ipfsClientOrOptions = kuboRpcModule.create({ url: ipfsApiUrl, }); diff --git a/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/logging.test.ts b/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/logging.test.ts index f55d81e3ac9..e0c668aaa5d 100644 --- a/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/logging.test.ts +++ b/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/logging.test.ts @@ -3,7 +3,6 @@ import type { AddressInfo } from "net"; import { v4 as uuidv4 } from "uuid"; import "jest-extended"; import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs"; -import { create } from "ipfs-http-client"; import bodyParser from "body-parser"; import express from "express"; import { DefaultApi as ObjectStoreIpfsApi } from "@hyperledger/cactus-plugin-object-store-ipfs"; @@ -17,6 +16,8 @@ import { v4 as uuidV4 } from "uuid"; import { Configuration } from "@hyperledger/cactus-core-api"; import { PluginOdapGateway } from "../../../../main/typescript/gateway/plugin-odap-gateway"; import { GoIpfsTestContainer } from "@hyperledger/cactus-test-tooling"; +import { dynamicImportKuboRpcClientESMWorkaround } from "@hyperledger/cacti-esm-compat-hacks"; + import { OdapLocalLog, SessionData, @@ -86,7 +87,8 @@ beforeAll(async () => { const ipfsApiUrl = await ipfsContainer.getApiUrl(); - const ipfsClientOrOptions = create({ + const kuboRpcModule = await dynamicImportKuboRpcClientESMWorkaround(); + const ipfsClientOrOptions = kuboRpcModule.create({ url: ipfsApiUrl, }); diff --git a/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover-success.test.ts b/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover-success.test.ts index b346430d459..56d55204e61 100644 --- a/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover-success.test.ts +++ b/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover-success.test.ts @@ -3,7 +3,6 @@ import type { AddressInfo } from "net"; import { v4 as uuidv4 } from "uuid"; import "jest-extended"; import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs"; -import { create } from "ipfs-http-client"; import bodyParser from "body-parser"; import express from "express"; import { DefaultApi as ObjectStoreIpfsApi } from "@hyperledger/cactus-plugin-object-store-ipfs"; @@ -16,6 +15,7 @@ import { v4 as uuidV4 } from "uuid"; import { Configuration } from "@hyperledger/cactus-core-api"; import { PluginOdapGateway } from "../../../../main/typescript/gateway/plugin-odap-gateway"; import { GoIpfsTestContainer } from "@hyperledger/cactus-test-tooling"; +import { dynamicImportKuboRpcClientESMWorkaround } from "@hyperledger/cacti-esm-compat-hacks"; import { RecoverSuccessV1Message, SessionData, @@ -70,7 +70,8 @@ beforeAll(async () => { const ipfsApiUrl = await ipfsContainer.getApiUrl(); // t.comment(`Go IPFS Test Container API URL: ${ipfsApiUrl}`); - const ipfsClientOrOptions = create({ + const kuboRpcModule = await dynamicImportKuboRpcClientESMWorkaround(); + const ipfsClientOrOptions = kuboRpcModule.create({ url: ipfsApiUrl, }); diff --git a/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover-update-ack.test.ts b/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover-update-ack.test.ts index cb3b9b2e0a5..0cb34aeabcf 100644 --- a/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover-update-ack.test.ts +++ b/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover-update-ack.test.ts @@ -3,7 +3,6 @@ import type { AddressInfo } from "net"; import { v4 as uuidv4 } from "uuid"; import "jest-extended"; import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs"; -import { create } from "ipfs-http-client"; import bodyParser from "body-parser"; import express from "express"; import { DefaultApi as ObjectStoreIpfsApi } from "@hyperledger/cactus-plugin-object-store-ipfs"; @@ -16,6 +15,8 @@ import { v4 as uuidV4 } from "uuid"; import { Configuration } from "@hyperledger/cactus-core-api"; import { PluginOdapGateway } from "../../../../main/typescript/gateway/plugin-odap-gateway"; import { GoIpfsTestContainer } from "@hyperledger/cactus-test-tooling"; +import { dynamicImportKuboRpcClientESMWorkaround } from "@hyperledger/cacti-esm-compat-hacks"; + import { RecoverUpdateAckV1Message, SessionData, @@ -70,7 +71,8 @@ beforeAll(async () => { const ipfsApiUrl = await ipfsContainer.getApiUrl(); // t.comment(`Go IPFS Test Container API URL: ${ipfsApiUrl}`); - const ipfsClientOrOptions = create({ + const kuboRpcModule = await dynamicImportKuboRpcClientESMWorkaround(); + const ipfsClientOrOptions = kuboRpcModule.create({ url: ipfsApiUrl, }); diff --git a/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover-update.test.ts b/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover-update.test.ts index e66b318c2d7..697b327501d 100644 --- a/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover-update.test.ts +++ b/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover-update.test.ts @@ -3,7 +3,6 @@ import type { AddressInfo } from "net"; import { v4 as uuidv4 } from "uuid"; import "jest-extended"; import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs"; -import { create } from "ipfs-http-client"; import bodyParser from "body-parser"; import express from "express"; import { DefaultApi as ObjectStoreIpfsApi } from "@hyperledger/cactus-plugin-object-store-ipfs"; @@ -17,6 +16,7 @@ import { v4 as uuidV4 } from "uuid"; import { Configuration } from "@hyperledger/cactus-core-api"; import { PluginOdapGateway } from "../../../../main/typescript/gateway/plugin-odap-gateway"; import { GoIpfsTestContainer } from "@hyperledger/cactus-test-tooling"; +import { dynamicImportKuboRpcClientESMWorkaround } from "@hyperledger/cacti-esm-compat-hacks"; import { OdapLocalLog, RecoverUpdateV1Message, @@ -81,7 +81,8 @@ beforeAll(async () => { const ipfsApiUrl = await ipfsContainer.getApiUrl(); // t.comment(`Go IPFS Test Container API URL: ${ipfsApiUrl}`); - const ipfsClientOrOptions = create({ + const kuboRpcModule = await dynamicImportKuboRpcClientESMWorkaround(); + const ipfsClientOrOptions = kuboRpcModule.create({ url: ipfsApiUrl, }); diff --git a/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover.test.ts b/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover.test.ts index 6c0c057aa21..2e447fabe2b 100644 --- a/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover.test.ts +++ b/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/recovery/recover.test.ts @@ -3,7 +3,6 @@ import type { AddressInfo } from "net"; import { v4 as uuidv4 } from "uuid"; import "jest-extended"; import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs"; -import { create } from "ipfs-http-client"; import bodyParser from "body-parser"; import express from "express"; import { DefaultApi as ObjectStoreIpfsApi } from "@hyperledger/cactus-plugin-object-store-ipfs"; @@ -20,6 +19,7 @@ import { PluginOdapGateway, } from "../../../../main/typescript/gateway/plugin-odap-gateway"; import { GoIpfsTestContainer } from "@hyperledger/cactus-test-tooling"; +import { dynamicImportKuboRpcClientESMWorkaround } from "@hyperledger/cacti-esm-compat-hacks"; import { RecoverV1Message } from "../../../../main/typescript/public-api"; import { randomInt } from "crypto"; import { checkValidRecoverMessage } from "../../../../main/typescript/gateway/recovery/recover"; @@ -73,7 +73,8 @@ beforeAll(async () => { const ipfsApiUrl = await ipfsContainer.getApiUrl(); - const ipfsClientOrOptions = create({ + const kuboRpcModule = await dynamicImportKuboRpcClientESMWorkaround(); + const ipfsClientOrOptions = kuboRpcModule.create({ url: ipfsApiUrl, }); diff --git a/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/server/commit-final.test.ts b/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/server/commit-final.test.ts index 8ca87559e2b..6372cd08fa3 100644 --- a/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/server/commit-final.test.ts +++ b/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/server/commit-final.test.ts @@ -2,7 +2,6 @@ import { randomInt } from "crypto"; import { v4 as uuidv4 } from "uuid"; import bodyParser from "body-parser"; import http, { Server } from "http"; -import { create } from "ipfs-http-client"; import { SHA256 } from "crypto-js"; import { IPluginOdapGatewayConstructorOptions, @@ -22,6 +21,7 @@ import { import { Configuration } from "@hyperledger/cactus-core-api"; import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs"; import { GoIpfsTestContainer } from "@hyperledger/cactus-test-tooling"; +import { dynamicImportKuboRpcClientESMWorkaround } from "@hyperledger/cacti-esm-compat-hacks"; import express from "express"; import { AddressInfo } from "net"; @@ -77,7 +77,8 @@ beforeAll(async () => { const ipfsApiUrl = await ipfsContainer.getApiUrl(); - const ipfsClientOrOptions = create({ + const kuboRpcModule = await dynamicImportKuboRpcClientESMWorkaround(); + const ipfsClientOrOptions = kuboRpcModule.create({ url: ipfsApiUrl, }); diff --git a/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/server/lock-evidence.test.ts b/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/server/lock-evidence.test.ts index 44daece1932..525f6ae6488 100644 --- a/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/server/lock-evidence.test.ts +++ b/packages/cactus-plugin-odap-hermes/src/test/typescript/unit/server/lock-evidence.test.ts @@ -2,7 +2,6 @@ import { randomInt } from "crypto"; import { v4 as uuidv4 } from "uuid"; import bodyParser from "body-parser"; import http, { Server } from "http"; -import { create } from "ipfs-http-client"; import { IPluginOdapGatewayConstructorOptions, OdapMessageType, @@ -23,6 +22,8 @@ import { import { Configuration } from "@hyperledger/cactus-core-api"; import { PluginObjectStoreIpfs } from "@hyperledger/cactus-plugin-object-store-ipfs"; import { GoIpfsTestContainer } from "@hyperledger/cactus-test-tooling"; +import { dynamicImportKuboRpcClientESMWorkaround } from "@hyperledger/cacti-esm-compat-hacks"; + import express from "express"; import { AddressInfo } from "net"; @@ -79,7 +80,8 @@ beforeAll(async () => { const ipfsApiUrl = await ipfsContainer.getApiUrl(); - const ipfsClientOrOptions = create({ + const kuboRpcModule = await dynamicImportKuboRpcClientESMWorkaround(); + const ipfsClientOrOptions = kuboRpcModule.create({ url: ipfsApiUrl, }); diff --git a/packages/cactus-plugin-odap-hermes/tsconfig.json b/packages/cactus-plugin-odap-hermes/tsconfig.json index 061dd4e7d6c..f112e91e8e2 100644 --- a/packages/cactus-plugin-odap-hermes/tsconfig.json +++ b/packages/cactus-plugin-odap-hermes/tsconfig.json @@ -35,6 +35,9 @@ }, { "path": "../../extensions/cactus-plugin-object-store-ipfs/tsconfig.json" + }, + { + "path": "../../packages/cacti-esm-compat-hacks/tsconfig.json" } ] } \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 5895bbc8107..7406e5862d4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8052,6 +8052,7 @@ __metadata: version: 0.0.0-use.local resolution: "@hyperledger/cactus-plugin-odap-hermes@workspace:packages/cactus-plugin-odap-hermes" dependencies: + "@hyperledger/cacti-esm-compat-hacks": 2.0.0-alpha.2 "@hyperledger/cactus-cmd-api-server": 2.0.0-alpha.2 "@hyperledger/cactus-common": 2.0.0-alpha.2 "@hyperledger/cactus-core": 2.0.0-alpha.2 @@ -8067,7 +8068,6 @@ __metadata: axios: 1.5.1 crypto-js: 4.0.0 fabric-network: 2.2.19 - ipfs-http-client: 60.0.1 knex: 2.4.0 secp256k1: 4.0.3 socket.io: 4.5.4