Skip to content

Commit

Permalink
update eventbus imports
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomendezroyo committed Sep 19, 2023
1 parent 9a81f55 commit e7c42b6
Show file tree
Hide file tree
Showing 45 changed files with 44 additions and 144 deletions.
2 changes: 1 addition & 1 deletion packages/dappmanager/src/api/routes/dataSend.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as db from "../../db/index.js";
import { eventBus } from "../../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { HttpError, wrapHandler } from "../utils.js";
import { getDnpFromIp } from "./sign.js";

Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/api/routes/notificationSend.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getDnpFromIp } from "./sign.js";
import { eventBus } from "../../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { HttpError, wrapHandler } from "../utils.js";

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/api/startHttpApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
} from "./sessions/index.js";
import { mapSubscriptionsToEventBus } from "./subscriptions.js";
import { Logs } from "@dappnode/logger";
import { EventBus } from "../eventBus.js";
import { EventBus } from "@dappnode/eventbus";
import {
Routes,
RpcPayload,
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/api/subscriptions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EventBus } from "../eventBus.js";
import { EventBus } from "@dappnode/eventbus";
import { Routes, Subscriptions } from "@dappnode/common";

export function mapSubscriptionsToEventBus(
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/calls/ethicalMetrics.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EthicalMetricsConfig } from "@dappnode/common";
import { eventBus } from "../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { listPackageNoThrow } from "../modules/docker/list/listPackages.js";
import { packageRestart } from "./packageRestart.js";
import * as db from "../db/index.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/calls/fetchDirectory.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { eventBus } from "../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { DirectoryItem, DirectoryItemOk } from "@dappnode/common";
import { logs } from "@dappnode/logger";
import { listPackages } from "../modules/docker/list/index.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/calls/fetchRegistry.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getEthersProvider } from "../modules/ethClient/index.js";
import { ReleaseFetcher } from "../modules/release/index.js";
import { listPackages } from "../modules/docker/list/index.js";
import { eventBus } from "../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { throttle } from "lodash-es";
import { NoImageForArchError } from "../modules/release/errors.js";
import { logs } from "@dappnode/logger";
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/calls/newFeatureStatusSet.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as db from "../db/index.js";
import { eventBus } from "../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { NewFeatureId, NewFeatureStatus } from "@dappnode/common";

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/calls/notificationsTest.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { eventBus } from "../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { PackageNotification, NotificationType } from "@dappnode/common";
/**
* Adds a notification to be shown the UI.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as db from "../db/index.js";
import { eventBus } from "../eventBus.js";
import { eventBus } from "@dappnode/eventbus";

/**
* Toggles the visibility of a getting started block
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/calls/packageRemove.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from "fs";
import { eventBus } from "../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { params } from "@dappnode/params";
import { dockerComposeDown } from "../modules/docker/compose/index.js";
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/calls/packageRestart.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from "fs";
import { params } from "@dappnode/params";
import { eventBus } from "../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import * as getPath from "../utils/getPath.js";
import { dockerContainerRestart } from "../modules/docker/index.js";
import { listPackage } from "../modules/docker/list/index.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/calls/packageRestartVolumes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from "fs";
import { removeNamedVolume } from "../modules/docker/removeNamedVolume.js";
import { eventBus } from "../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { params } from "@dappnode/params";
import { logs } from "@dappnode/logger";
import * as getPath from "../utils/getPath.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/calls/packageSentDataDelete.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as db from "../db/index.js";
import { eventBus } from "../eventBus.js";
import { eventBus } from "@dappnode/eventbus";

/**
* Delete package sent data key
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/calls/packageSetEnvironment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { eventBus } from "../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { listPackage } from "../modules/docker/list/index.js";
import { ComposeFileEditor } from "../modules/compose/editor.js";
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/calls/packageSetPortMappings.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { eventBus } from "../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { params } from "@dappnode/params";
import { listPackage } from "../modules/docker/list/index.js";
import { ComposeFileEditor } from "../modules/compose/editor.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/calls/packageStartStop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
dockerContainerStop,
dockerContainerStart
} from "../modules/docker/index.js";
import { eventBus } from "../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { params } from "@dappnode/params";
import { getServicesSharingPid } from "../utils/pid.js";
import { ComposeFileEditor } from "../modules/compose/editor.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/calls/seedPhraseSet.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { storePrivateKeyFromSeed } from "../utils/seedPhrase.js";
import { decrypt } from "../utils/publickeyEncryption.js";
import * as db from "../db/index.js";
import { eventBus } from "../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { params } from "@dappnode/params";

const adminPublicKey = params.ADMIN_NACL_PUBLIC_KEY;
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/calls/setStaticIp.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as db from "../db/index.js";
import * as dyndns from "../modules/dyndns/index.js";
import { eventBus } from "../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { logs } from "@dappnode/logger";

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/calls/telegram.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as db from "../db/index.js";
import { eventBus } from "../eventBus.js";
import { eventBus } from "@dappnode/eventbus";

/**
* Returns the status of the telegram bot
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/calls/volumeRemove.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { removeNamedVolume } from "../modules/docker/removeNamedVolume.js";
import { eventBus } from "../eventBus.js";
import { eventBus } from "@dappnode/eventbus";

/**
* Removes a docker volume by name
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/daemons/autoUpdates/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { params } from "@dappnode/params";
import { eventBus } from "../../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { ReleaseFetcher } from "../../modules/release/index.js";
import { listPackages } from "../../modules/docker/list/index.js";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { valid, lte } from "semver";
import { params } from "@dappnode/params";
import * as db from "../../db/index.js";
import { eventBus } from "../../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { ReleaseFetcher } from "../../modules/release/index.js";
import { prettyDnpName } from "../../utils/format.js";
import { CoreUpdateDataAvailable } from "@dappnode/common";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { valid, lte } from "semver";
import { params } from "@dappnode/params";
import { listPackages } from "../../modules/docker/list/index.js";
import { eventBus } from "../../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { ReleaseFetcher } from "../../modules/release/index.js";
import { packageInstall } from "../../calls/index.js";
import { logs } from "@dappnode/logger";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { eventBus } from "../../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { params } from "@dappnode/params";
import {
isUpdateDelayCompleted,
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/daemons/diskUsage/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as db from "../../db/index.js";
import shellExec from "../../utils/shell.js";
import { params } from "@dappnode/params";
import { eventBus } from "../../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { logs } from "@dappnode/logger";
import { runAtMostEvery } from "../../utils/asyncFlows.js";
import { prettyDnpName } from "../../utils/format.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/daemons/dyndns/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { eventBus } from "../../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { params } from "@dappnode/params";
import * as db from "../../db/index.js";
import updateIp from "../../modules/dyndns/updateIp.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/daemons/ethMultiClient/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as db from "../../db/index.js";
import { eventBus } from "../../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { params } from "@dappnode/params";
import { packageInstall } from "../../calls/index.js";
import { listPackageNoThrow } from "../../modules/docker/list/index.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/daemons/ethicalMetrics/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { eventBus } from "../../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { params } from "@dappnode/params";
import { runOnlyOneSequentially } from "../../utils/asyncFlows.js";
import { runAtMostEvery } from "../../utils/asyncFlows.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/daemons/natRenewal/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as upnpc from "../../modules/upnpc/index.js";
import { eventBus } from "../../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { params } from "@dappnode/params";
import * as db from "../../db/index.js";
import getPortsToOpen from "./getPortsToOpen.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/daemons/nsupdate/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import retry from "async-retry";
import { eventBus } from "../../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import * as db from "../../db/index.js";
import { params } from "@dappnode/params";
import { listContainers } from "../../modules/docker/list/index.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/daemons/stakerConfig/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { eventBus } from "../../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import * as db from "../../db/index.js";
import { logs } from "@dappnode/logger";
import { pickStakerItemData } from "../../modules/stakerConfig/utils.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/daemons/telegramBot/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as db from "../../db/index.js";
import { eventBus } from "../../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { logs } from "@dappnode/logger";
import { runOnlyOneSequentially } from "../../utils/asyncFlows.js";
import { formatNotification } from "./formatNotification.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/db/ethClient.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { dbCache, dbMain } from "./dbFactory.js";
import { EthClientSyncedNotificationStatus } from "../types.js";
import { EthClientInstallStatus } from "../modules/ethClient/types.js";
import { eventBus } from "../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import {
EthClientTarget,
EthClientRemote,
Expand Down
100 changes: 0 additions & 100 deletions packages/dappmanager/src/eventBus.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/dappmanager/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as db from "./db/index.js";
import { eventBus } from "./eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import initializeDb from "./initializeDb.js";
import { createGlobalEnvsEnvFile } from "./modules/globalEnvs.js";
import { generateKeyPair } from "./utils/publickeyEncryption.js";
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/initializeDb.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as db from "./db/index.js";
import { eventBus } from "./eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import * as dyndns from "./modules/dyndns/index.js";
import getDappmanagerImage from "./utils/getDappmanagerImage.js";
import getServerName from "./utils/getServerName.js";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isEqual } from "lodash-es";
import { Eth2ClientTarget, EthClientRemote } from "@dappnode/common";
import * as db from "../../db/index.js";
import { eventBus } from "../../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { logs } from "@dappnode/logger";
import { getConsensusUserSettings } from "../stakerConfig/utils.js";
import { packageGet } from "../../calls/packageGet.js";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as db from "../../db/index.js";
import { eventBus } from "../../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { Eth2ClientTarget, EthClientStatus } from "@dappnode/common";

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/dappmanager/src/modules/installer/afterInstall.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { eventBus } from "../../eventBus.js";
import { eventBus } from "@dappnode/eventbus";
import { flagPackagesAreNotInstalling } from "./packageIsInstalling.js";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { listPackageNoThrow } from "../docker/list/index.js";
import { ethicalMetricsDnpName } from "../ethicalMetrics/index.js";
import * as db from "../../db/index.js";
import { ComposeFileEditor } from "../compose/editor.js";
import { eventBus } from "../../eventBus.js";
import { eventBus } from "@dappnode/eventbus";

/**
* Gets the email env from the ethical metrics package (if exists) and sets it
Expand Down
Loading

0 comments on commit e7c42b6

Please sign in to comment.