migrate to "export default"

also, set no-use-before-define in linter
This commit is contained in:
Girish Ramakrishnan
2026-02-14 15:43:24 +01:00
parent ddb46646fa
commit 36aa641cb9
231 changed files with 2846 additions and 2728 deletions
+49 -48
View File
@@ -1,23 +1,23 @@
import * as addonConfigs from './addonconfigs.js';
import addonConfigs from './addonconfigs.js';
import apps from './apps.js';
import assert from 'node:assert';
import blobs from './blobs.js';
import BoxError from './boxerror.js';
import * as branding from './branding.js';
import branding from './branding.js';
import constants from './constants.js';
import crypto from 'node:crypto';
import * as dashboard from './dashboard.js';
import dashboard from './dashboard.js';
import debugModule from 'debug';
import * as dig from './dig.js';
import * as docker from './docker.js';
import dig from './dig.js';
import docker from './docker.js';
import eventlog from './eventlog.js';
import fs from 'node:fs';
import hat from './hat.js';
import http from 'http';
import infra from './infra_version.js';
import * as logs from './logs.js';
import * as mail from './mail.js';
import * as mailServer from './mailserver.js';
import logs from './logs.js';
import mail from './mail.js';
import mailServer from './mailserver.js';
import oidcClients from './oidcclients.js';
import os from 'node:os';
import path from 'node:path';
@@ -26,8 +26,8 @@ import { pipeFileToRequest, pipeRequestToFile } from '@cloudron/pipework';
import promiseRetry from './promise-retry.js';
import safe from 'safetydance';
import semver from 'semver';
import * as settings from './settings.js';
import * as sftp from './sftp.js';
import settings from './settings.js';
import sftp from './sftp.js';
import shellModule from './shell.js';
import superagent from '@cloudron/superagent';
@@ -39,44 +39,6 @@ const SERVICE_STATUS_ACTIVE = 'active';
const SERVICE_STATUS_STOPPED = 'stopped';
const SERVICE_STATUS_DISABLED = 'disabled';
export default {
getServiceConfig,
listServices,
getServiceStatus,
getServiceLogs,
configureService,
restartService,
rebuildService,
startAppServices,
stopAppServices,
startServices,
moveDataDir, // localstorage specific command
setupAddons,
teardownAddons,
backupAddons,
restoreAddons,
clearAddons,
checkAddonsSupport,
getEnvironment,
getContainerNamesSync,
getContainerDetails,
// exported only for apptask.js to update immich pgvectors extension - can be removed later
_postgreSqlNames: postgreSqlNames,
SERVICE_STATUS_STARTING,
SERVICE_STATUS_ACTIVE,
SERVICE_STATUS_STOPPED,
SERVICE_STATUS_DISABLED,
};
const NOOP = async function (/*app, options*/) {};
const RMADDONDIR_CMD = path.join(import.meta.dirname, 'scripts/rmaddondir.sh');
@@ -2185,3 +2147,42 @@ async function moveDataDir(app, targetVolumeId, targetVolumePrefix) {
if (error) throw new BoxError(BoxError.EXTERNAL_ERROR, `Error migrating data directory: ${error.message}`);
}
}
export default {
getServiceConfig,
listServices,
getServiceStatus,
getServiceLogs,
configureService,
restartService,
rebuildService,
startAppServices,
stopAppServices,
startServices,
moveDataDir, // localstorage specific command
setupAddons,
teardownAddons,
backupAddons,
restoreAddons,
clearAddons,
checkAddonsSupport,
getEnvironment,
getContainerNamesSync,
getContainerDetails,
// exported only for apptask.js to update immich pgvectors extension - can be removed later
_postgreSqlNames: postgreSqlNames,
SERVICE_STATUS_STARTING,
SERVICE_STATUS_ACTIVE,
SERVICE_STATUS_STOPPED,
SERVICE_STATUS_DISABLED,
};