mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 02:00:10 +02:00
Revert "[web] Migrate modules/server-ce-scripts to ESM"
GitOrigin-RevId: 61d971396b801e7bb3da1c5af7bd5ea4d91f3c9f
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import minimist from 'minimist'
|
||||
import {
|
||||
const minimist = require('minimist')
|
||||
const {
|
||||
db,
|
||||
ObjectId,
|
||||
waitForDb,
|
||||
} from '../../../app/src/infrastructure/mongodb.js'
|
||||
} = require('../../../app/src/infrastructure/mongodb')
|
||||
|
||||
async function main() {
|
||||
await waitForDb()
|
||||
@@ -1,9 +1,6 @@
|
||||
import mongodb from 'mongodb-legacy'
|
||||
import { waitForDb, db } from '../../../app/src/infrastructure/mongodb.js'
|
||||
import mongoose from '../../../app/src/infrastructure/Mongoose.js'
|
||||
|
||||
const { ObjectId } = mongodb
|
||||
const { getMongoClient } = mongoose
|
||||
const { ObjectId } = require('mongodb-legacy')
|
||||
const { waitForDb, db } = require('../../../app/src/infrastructure/mongodb')
|
||||
const { getMongoClient } = require('../../../app/src/infrastructure/Mongoose')
|
||||
|
||||
const MIN_MONGO_VERSION = [5, 0]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import RedisWrapper from '../../../app/src/infrastructure/RedisWrapper.js'
|
||||
const RedisWrapper = require('../../../app/src/infrastructure/RedisWrapper')
|
||||
const rclient = RedisWrapper.client('health_check')
|
||||
rclient.on('error', err => {
|
||||
console.error('Cannot connect to redis.')
|
||||
@@ -1,4 +1,4 @@
|
||||
import { waitForDb, db } from '../../../app/src/infrastructure/mongodb.js'
|
||||
const { waitForDb, db } = require('../../../app/src/infrastructure/mongodb')
|
||||
|
||||
async function readImagesInUse() {
|
||||
await waitForDb()
|
||||
@@ -1,6 +1,6 @@
|
||||
import minimist from 'minimist'
|
||||
import { db, waitForDb } from '../../../app/src/infrastructure/mongodb.js'
|
||||
import UserRegistrationHandler from '../../../app/src/Features/User/UserRegistrationHandler.js'
|
||||
const minimist = require('minimist')
|
||||
const { db, waitForDb } = require('../../../app/src/infrastructure/mongodb')
|
||||
const UserRegistrationHandler = require('../../../app/src/Features/User/UserRegistrationHandler')
|
||||
|
||||
async function main() {
|
||||
await waitForDb()
|
||||
@@ -1,6 +1,6 @@
|
||||
import { waitForDb } from '../../../app/src/infrastructure/mongodb.js'
|
||||
import UserGetter from '../../../app/src/Features/User/UserGetter.js'
|
||||
import UserDeleter from '../../../app/src/Features/User/UserDeleter.js'
|
||||
const { waitForDb } = require('../../../app/src/infrastructure/mongodb')
|
||||
const UserGetter = require('../../../app/src/Features/User/UserGetter')
|
||||
const UserDeleter = require('../../../app/src/Features/User/UserDeleter')
|
||||
|
||||
async function main() {
|
||||
await waitForDb()
|
||||
@@ -9,16 +9,16 @@
|
||||
// Intended for Server Pro customers migrating user emails from one domain to
|
||||
// another.
|
||||
|
||||
import minimist from 'minimist'
|
||||
const minimist = require('minimist')
|
||||
const { waitForDb } = require('../../../app/src/infrastructure/mongodb')
|
||||
|
||||
import { waitForDb } from '../../../app/src/infrastructure/mongodb.js'
|
||||
import os from 'node:os'
|
||||
import fs from 'node:fs'
|
||||
import * as csv from 'csv/sync'
|
||||
import { parseEmail } from '../../../app/src/Features/Helpers/EmailHelper.js'
|
||||
import UserGetter from '../../../app/src/Features/User/UserGetter.js'
|
||||
import UserUpdater from '../../../app/src/Features/User/UserUpdater.js'
|
||||
import UserSessionsManager from '../../../app/src/Features/User/UserSessionsManager.js'
|
||||
const os = require('os')
|
||||
const fs = require('fs')
|
||||
const csv = require('csv/sync')
|
||||
const { parseEmail } = require('../../../app/src/Features/Helpers/EmailHelper')
|
||||
const UserGetter = require('../../../app/src/Features/User/UserGetter')
|
||||
const UserUpdater = require('../../../app/src/Features/User/UserUpdater')
|
||||
const UserSessionsManager = require('../../../app/src/Features/User/UserSessionsManager')
|
||||
|
||||
const hostname = os.hostname()
|
||||
const scriptTimestamp = new Date().toISOString()
|
||||
@@ -1,5 +1,5 @@
|
||||
import minimist from 'minimist'
|
||||
import { db, waitForDb } from '../../../app/src/infrastructure/mongodb.js'
|
||||
const minimist = require('minimist')
|
||||
const { db, waitForDb } = require('../../../app/src/infrastructure/mongodb')
|
||||
|
||||
async function main() {
|
||||
await waitForDb()
|
||||
@@ -1,11 +1,10 @@
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import Settings from '@overleaf/settings'
|
||||
import logger from '@overleaf/logger'
|
||||
import { db, waitForDb } from '../../../app/src/infrastructure/mongodb.js'
|
||||
import {
|
||||
const Settings = require('@overleaf/settings')
|
||||
const logger = require('@overleaf/logger')
|
||||
const { db, waitForDb } = require('../../../app/src/infrastructure/mongodb')
|
||||
const {
|
||||
mergeFeatures,
|
||||
compareFeatures,
|
||||
} from '../../../app/src/Features/Subscription/FeaturesHelper.js'
|
||||
} = require('../../../app/src/Features/Subscription/FeaturesHelper')
|
||||
const DRY_RUN = !process.argv.includes('--dry-run=false')
|
||||
|
||||
async function main(DRY_RUN, defaultFeatures) {
|
||||
@@ -41,9 +40,9 @@ async function main(DRY_RUN, defaultFeatures) {
|
||||
}
|
||||
}
|
||||
|
||||
export default main
|
||||
module.exports = main
|
||||
|
||||
if (fileURLToPath(import.meta.url) === process.argv[1]) {
|
||||
if (require.main === module) {
|
||||
if (DRY_RUN) {
|
||||
console.error('---')
|
||||
console.error('Dry-run enabled, use --dry-run=false to commit changes')
|
||||
Reference in New Issue
Block a user