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
+63 -63
View File
@@ -1,32 +1,32 @@
import * as appPasswords from './apppasswords.js';
import appPasswords from './apppasswords.js';
import assert from 'node:assert';
import BoxError from './boxerror.js';
import crypto from 'node:crypto';
import constants from './constants.js';
import * as dashboard from './dashboard.js';
import * as database from './database.js';
import dashboard from './dashboard.js';
import database from './database.js';
import debugModule from 'debug';
import eventlog from './eventlog.js';
import * as externalLdap from './externalldap.js';
import externalLdap from './externalldap.js';
import hat from './hat.js';
import * as mail from './mail.js';
import * as mailer from './mailer.js';
import mail from './mail.js';
import mailer from './mailer.js';
import mysql from 'mysql2';
import * as notifications from './notifications.js';
import notifications from './notifications.js';
import oidcClients from './oidcclients.js';
import * as passkeys from './passkeys.js';
import passkeys from './passkeys.js';
import qrcode from 'qrcode';
import safe from 'safetydance';
import * as settings from './settings.js';
import settings from './settings.js';
import speakeasy from 'speakeasy';
import * as tokens from './tokens.js';
import * as translations from './translations.js';
import tokens from './tokens.js';
import translations from './translations.js';
import { UAParser as uaParser } from 'ua-parser-js';
import * as userDirectory from './user-directory.js';
import userDirectory from './user-directory.js';
import superagent from '@cloudron/superagent';
import util from 'node:util';
import * as validator from './validator.js';
import * as _ from './underscore.js';
import validator from './validator.js';
import _ from './underscore.js';
const debug = debugModule('box:user');
@@ -38,55 +38,6 @@ const ROLE_USER_MANAGER = 'usermanager';
const ROLE_MAIL_MANAGER = 'mailmanager';
const ROLE_OWNER = 'owner';
export {
removePrivateFields,
add,
createOwner,
isActivated,
list,
listPaged,
get,
getByInviteToken,
getByResetToken,
getByUsername,
getByEmail,
getOwner,
getAdmins,
getSuperadmins,
verifyWithId,
verifyWithUsername,
verifyWithEmail,
setPassword,
setGhost,
updateProfile,
update,
del,
setTwoFactorAuthenticationSecret,
enableTwoFactorAuthentication,
disableTwoFactorAuthentication,
sendPasswordResetByIdentifier,
getPasswordResetLink,
sendPasswordResetEmail,
getInviteLink,
sendInviteEmail,
notifyLoginLocation,
setupAccount,
setAvatar,
getAvatar,
getBackgroundImage,
setBackgroundImage,
setNotificationConfig,
resetSources,
parseDisplayName,
AP_MAIL,
AP_WEBADMIN,
ROLE_ADMIN,
ROLE_USER,
ROLE_USER_MANAGER,
ROLE_MAIL_MANAGER,
ROLE_OWNER,
compareRoles,
};
// the avatar and backgroundImage fields are special and not added here to reduce response sizes
const USERS_FIELDS = [ 'id', 'username', 'email', 'fallbackEmail', 'password', 'salt', 'creationTime', 'inviteToken', 'resetToken', 'displayName', 'language',
@@ -1046,3 +997,52 @@ function parseDisplayName(displayName) {
return { firstName, lastName, middleName };
}
export default {
removePrivateFields,
add,
createOwner,
isActivated,
list,
listPaged,
get,
getByInviteToken,
getByResetToken,
getByUsername,
getByEmail,
getOwner,
getAdmins,
getSuperadmins,
verifyWithId,
verifyWithUsername,
verifyWithEmail,
setPassword,
setGhost,
updateProfile,
update,
del,
setTwoFactorAuthenticationSecret,
enableTwoFactorAuthentication,
disableTwoFactorAuthentication,
sendPasswordResetByIdentifier,
getPasswordResetLink,
sendPasswordResetEmail,
getInviteLink,
sendInviteEmail,
notifyLoginLocation,
setupAccount,
setAvatar,
getAvatar,
getBackgroundImage,
setBackgroundImage,
setNotificationConfig,
resetSources,
parseDisplayName,
AP_MAIL,
AP_WEBADMIN,
ROLE_ADMIN,
ROLE_USER,
ROLE_USER_MANAGER,
ROLE_MAIL_MANAGER,
ROLE_OWNER,
compareRoles,
};